<?php
include('Student.php');
include('Course.php');
$students = array();


$first = new Student("Doe", "John", "Junior");
$first->add_email('home', 'john@doe.com');
$first->add_email('work', 'jdoe@mcdonalds.com');
$first->add_subject_grade('Math', 65);    
$first->add_subject_grade('English', 75); 
$first->add_subject_grade('Chinese', 55); 
$students['j123'] = $first;


$second = new Student("Einstein", "Albert", "Freshman");
$second->add_email('home', 'albert@braniacs.com');
$second->add_email('work1', 'a_einstein@bcit.ca');
$second->add_email('work2', 'albert@physics.mit.edu');
$second->add_subject_grade('Math', 95);    
$second->add_subject_grade('English', 80); 
$second->add_subject_grade('Chinese', 50); 
$students['a456'] = $second;


$third = new Student("Wang", "Yekun", "Senior");
$third->add_email('home', 'Wangyekun.com');
$third->add_subject_grade('Math', 67.5);  
$third->add_subject_grade('English', 68); 
$third->add_subject_grade('Chinese', 67);  
$students['j789'] = $third;

$fourth = new Student("Gates", "Bill", "Junior");
$fourth->add_email('home', 'billmiecd.com');
$fourth->add_subject_grade('Math', 98);    
$fourth->add_subject_grade('English', 99); 
$fourth->add_subject_grade('Chinese', 98.5); 
$students['b012'] = $fourth;


ksort($students);
echo "<h2>Student List</h2>";
foreach ($students as $student) {
    echo $student->toString();
}

?>